USE [pbvs]
GO

/****** Object:  Table [dbo].[Clients]    Script Date: 02/20/2013 20:50:56 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Clients](
	[ClientId] [int] IDENTITY(1,1) NOT NULL,
	[Email] [nvarchar](255) NOT NULL,
	[FirstName] [nvarchar](255) NOT NULL,
	[LastName] [nvarchar](255) NOT NULL,
	[CompanyName] [nvarchar](255) NOT NULL,
	[Address] [nvarchar](255) NOT NULL,
	[Address2] [nvarchar](255) NOT NULL,
	[City] [nvarchar](255) NOT NULL,
	[State] [nvarchar](2) NOT NULL,
	[Zip] [nvarchar](10) NOT NULL,
	[Phone] [nvarchar](10) NOT NULL,
	[LoginId] [int] NOT NULL,
 CONSTRAINT [PK_CLient] PRIMARY KEY CLUSTERED 
(
	[ClientId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[Clients]  WITH CHECK ADD  CONSTRAINT [FK_Client_Client] FOREIGN KEY([LoginId])
REFERENCES [dbo].[Logins] ([LoginId])
ON UPDATE CASCADE
ON DELETE CASCADE
GO

ALTER TABLE [dbo].[Clients] CHECK CONSTRAINT [FK_Client_Client]
GO

ALTER TABLE [dbo].[Clients] ADD  CONSTRAINT [DF_CLient_LoginId]  DEFAULT ((0)) FOR [LoginId]
GO

